gtk4.git
4 years agoMerge branch 'text-undo-test' into 'master'
Matthias Clasen [Thu, 1 Jul 2021 22:25:18 +0000 (22:25 +0000)]
Merge branch 'text-undo-test' into 'master'

Add another text history test

See merge request GNOME/gtk!3713

4 years agoAdd another text history test
Matthias Clasen [Thu, 1 Jul 2021 22:08:05 +0000 (18:08 -0400)]
Add another text history test

Add a tests that checks we group undo actions as expected
when the user is typing.

4 years agoMerge branch 'wip/chergert/fix-texthistory-grouping' into 'master'
Matthias Clasen [Thu, 1 Jul 2021 14:17:25 +0000 (14:17 +0000)]
Merge branch 'wip/chergert/fix-texthistory-grouping' into 'master'

texthistory: hoist single actions from group

Closes gnome-text-editor#97

See merge request GNOME/gtk!3711

4 years agotexthistory: hoist single actions from group
Christian Hergert [Wed, 30 Jun 2021 23:40:15 +0000 (16:40 -0700)]
texthistory: hoist single actions from group

In many cases across GtkTextBuffer, we end up with operations performed
inside of a begin/end user action. Those can be coalesced into a single
sub-action within the group, and hoisted out of the group. Doing so
increases the chances that we chain similar actions together for words.

Additionally, this fixes an issue introduced in
6179886b14eccd3034dc8121aac7b709aac073ec for #3977 where GNOME Text Editor
started to group all possible actions into a single group.

Fixes GNOME/gnome-text-editor#97

4 years agoicontheme: Fix binding annotation
Benjamin Otte [Wed, 30 Jun 2021 18:55:25 +0000 (18:55 +0000)]
icontheme: Fix binding annotation

4 years agoMerge branch 'wayland-cursor-theme' into 'master'
Matthias Clasen [Tue, 29 Jun 2021 22:17:49 +0000 (22:17 +0000)]
Merge branch 'wayland-cursor-theme' into 'master'

wayland: Look for cursor themes in $HOME

Closes #4080

See merge request GNOME/gtk!3708

4 years agowayland: Look for cursor themes in $HOME
Matthias Clasen [Tue, 29 Jun 2021 20:57:15 +0000 (16:57 -0400)]
wayland: Look for cursor themes in $HOME

We should look in the same places that libXcursor does,
so add $XDG_DATA_HOME/icons and $HOME/.icons to the list.

Fixes: #4080
4 years agoMerge branch 'more-vbo-overflow' into 'master'
Matthias Clasen [Tue, 29 Jun 2021 20:36:42 +0000 (20:36 +0000)]
Merge branch 'more-vbo-overflow' into 'master'

gsk: Use the right limit for batch size

See merge request GNOME/gtk!3707

4 years agogsk: Another vbo_size overflow fix
Matthias Clasen [Tue, 29 Jun 2021 19:22:40 +0000 (15:22 -0400)]
gsk: Another vbo_size overflow fix

We can overflow vbo_size not just by batching
too much, but also by producing humongous text
nodes. Split them up.

4 years agogsk: Use the right limit for batch size
Matthias Clasen [Tue, 29 Jun 2021 19:21:45 +0000 (15:21 -0400)]
gsk: Use the right limit for batch size

We use 16 bits, so G_MAXINT16 is one bit short.
Just make it explicit as 0xffff.

4 years agoMerge branch 'hello-world-fixup' into 'master'
Matthias Clasen [Tue, 29 Jun 2021 16:59:45 +0000 (16:59 +0000)]
Merge branch 'hello-world-fixup' into 'master'

Update hello-world.c

See merge request GNOME/gtk!3706

4 years agoUpdate hello-world.c
Matthias Clasen [Tue, 29 Jun 2021 12:01:37 +0000 (08:01 -0400)]
Update hello-world.c

Simplify the code a bit and make the window
match the existing screenshot.

4 years agoMerge branch 'avoid-batch-size-overflow' into 'master'
Matthias Clasen [Mon, 28 Jun 2021 21:35:15 +0000 (21:35 +0000)]
Merge branch 'avoid-batch-size-overflow' into 'master'

Revert "gsk: Respect max element vertices limitation"

See merge request GNOME/gtk!3704

4 years agoMerge branch 'wip/exalm/buttons' into 'master'
Matthias Clasen [Mon, 28 Jun 2021 19:10:57 +0000 (19:10 +0000)]
Merge branch 'wip/exalm/buttons' into 'master'

GtkMenuButton icon+arrow support + fixes

Closes #3501

See merge request GNOME/gtk!3694

4 years agoMerge branch 'gtklistitemfactory-autocleanup' into 'master'
Matthias Clasen [Mon, 28 Jun 2021 19:10:04 +0000 (19:10 +0000)]
Merge branch 'gtklistitemfactory-autocleanup' into 'master'

gtk: Define the GtkListItemFactory autocleanup func

See merge request GNOME/gtk!3703

4 years agogsk: Don't overflow vbo_count
Matthias Clasen [Mon, 28 Jun 2021 19:00:41 +0000 (15:00 -0400)]
gsk: Don't overflow vbo_count

We use 16 bits to store vbo_count, so we can't create
batches that have more than 65535 vertices. Pay attention
to that limit when merging batches.

4 years agoRevert "gsk: Respect max element vertices limitation"
Matthias Clasen [Mon, 28 Jun 2021 18:50:58 +0000 (14:50 -0400)]
Revert "gsk: Respect max element vertices limitation"

This reverts commit f58fc6b22e143e43b45f297795959f217a26d95f.

4 years agogtk: Define the GtkListItemFactory autocleanup func
Adrien Plazas [Mon, 28 Jun 2021 12:00:33 +0000 (14:00 +0200)]
gtk: Define the GtkListItemFactory autocleanup func

4 years agoMerge branch 'ebassi/issues-4076' into 'master'
Emmanuele Bassi [Sun, 27 Jun 2021 15:10:15 +0000 (15:10 +0000)]
Merge branch 'ebassi/issues-4076' into 'master'

docs: Use code blocks for inline XML

Closes #4076

See merge request GNOME/gtk!3702

4 years agodocs: Use code blocks for inline XML
Emmanuele Bassi [Sun, 27 Jun 2021 14:25:18 +0000 (15:25 +0100)]
docs: Use code blocks for inline XML

Otherwise the markdown renderer will just ignore them.

Fixes: #4076
4 years agoUpdate Portuguese translation
Hugo Carvalho [Sun, 27 Jun 2021 09:44:44 +0000 (09:44 +0000)]
Update Portuguese translation

(cherry picked from commit a9c68757b5c339ea4a17a03d4f20edef197c717b)

4 years agomenubutton: Don't hardcode label<->arrow spacing
Alexander Mikhaylenko [Thu, 24 Jun 2021 18:12:31 +0000 (23:12 +0500)]
menubutton: Don't hardcode label<->arrow spacing

This should come from the theme instead, as it does for icon<->arrow.

4 years agomenubutton: Add a way to always show arrow with image buttons
Alexander Mikhaylenko [Mon, 21 Jun 2021 10:13:16 +0000 (15:13 +0500)]
menubutton: Add a way to always show arrow with image buttons

Make sure the button still has the .image-button style class with an icon,
also add it to the initial state with only an arrow. Add a new
.arrow-button style class for the icon+arrow state so it's possible to
style it.

Remove spacing from the label+arrow variant to match, re-add it from the
stylesheet for both.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3501

4 years agomenubutton: Remove a random g_return_if_fail()
Alexander Mikhaylenko [Mon, 21 Jun 2021 09:32:44 +0000 (14:32 +0500)]
menubutton: Remove a random g_return_if_fail()

There's already one above.

4 years agomenubutton: Reset label when setting icon name and vice versa
Alexander Mikhaylenko [Mon, 21 Jun 2021 09:08:14 +0000 (14:08 +0500)]
menubutton: Reset label when setting icon name and vice versa

Match GtkButton.

4 years agobutton: Reset style classes when setting arbitrary children
Alexander Mikhaylenko [Mon, 21 Jun 2021 08:59:28 +0000 (13:59 +0500)]
button: Reset style classes when setting arbitrary children

Don't leave leftover .image-button or .text-button.

4 years agoMerge branch 'wip/sadiq/reveal-controls-on-touch' into 'master'
Matthias Clasen [Thu, 24 Jun 2021 15:11:33 +0000 (15:11 +0000)]
Merge branch 'wip/sadiq/reveal-controls-on-touch' into 'master'

video: Reveal controls on tap

See merge request GNOME/gtk!3648

4 years agoMerge branch 'wip/chergert/gdk-macos-gdkdrop' into 'master'
Matthias Clasen [Thu, 24 Jun 2021 15:03:19 +0000 (15:03 +0000)]
Merge branch 'wip/chergert/gdk-macos-gdkdrop' into 'master'

GdkDrop suport for macOS backend

See merge request GNOME/gtk!3683

4 years agoMerge branch 'dnd-fixes' into 'master'
Matthias Clasen [Thu, 24 Jun 2021 15:01:29 +0000 (15:01 +0000)]
Merge branch 'dnd-fixes' into 'master'

dnd: Add another assertion

See merge request GNOME/gtk!3689

4 years agoMerge branch 'ebassi/filechooser-no-trash' into 'master'
Matthias Clasen [Thu, 24 Jun 2021 14:59:43 +0000 (14:59 +0000)]
Merge branch 'ebassi/filechooser-no-trash' into 'master'

Never show the Trash in the FileChooserWidget side bar

Closes #674

See merge request GNOME/gtk!3692

4 years agoMerge branch 'checkbutton-release-outside' into 'master'
Matthias Clasen [Thu, 24 Jun 2021 14:58:42 +0000 (14:58 +0000)]
Merge branch 'checkbutton-release-outside' into 'master'

checkbutton: Match GtkButton behavior

Closes #4061

See merge request GNOME/gtk!3691

4 years agoMerge branch 'fix_tests_testdnd' into 'master'
Matthias Clasen [Thu, 24 Jun 2021 14:54:32 +0000 (14:54 +0000)]
Merge branch 'fix_tests_testdnd' into 'master'

make testdnd trashcan work again

See merge request GNOME/gtk!3700

4 years agoMerge branch 'macos-input-method' into 'master'
Matthias Clasen [Thu, 24 Jun 2021 14:50:59 +0000 (14:50 +0000)]
Merge branch 'macos-input-method' into 'master'

macos: fix the position of curosr of input method for macos.

Closes #4063

See merge request GNOME/gtk!3699

4 years agomake testdnd trashcan work again
Caolán McNamara [Wed, 23 Jun 2021 14:09:44 +0000 (15:09 +0100)]
make testdnd trashcan work again

so that dragging into the 'trashcan' is detected

4 years agoMerge branch 'gtklistitem-autocleanup' into 'master'
Emmanuele Bassi [Wed, 23 Jun 2021 13:09:28 +0000 (13:09 +0000)]
Merge branch 'gtklistitem-autocleanup' into 'master'

gtk: Define the GtkListItem autocleanup func

See merge request GNOME/gtk!3698

4 years agoMerge branch 'migration_patch' into 'master'
Emmanuele Bassi [Wed, 23 Jun 2021 13:08:07 +0000 (13:08 +0000)]
Merge branch 'migration_patch' into 'master'

Add section about `gtk_widget_set_app_paintable`

Closes #4007

See merge request GNOME/gtk!3641

4 years agoAdd section about `gtk_widget_set_app_paintable`
Jaap aarts [Wed, 23 Jun 2021 13:08:06 +0000 (13:08 +0000)]
Add section about `gtk_widget_set_app_paintable`

4 years agomacos: fix the position of curosr of input method for macos.
Zhi [Mon, 21 Jun 2021 23:20:53 +0000 (07:20 +0800)]
macos: fix the position of curosr of input method for macos.

In the refactoring from GdkWindow to GdkSurface, GtkWidget no longer
corresponds to a GdkSurface. We have to calculate the relative position
from GtkWidget to the GdkSurface.

Closes #4063.

4 years agogtk: Define the GtkListItem autocleanup func
Adrien Plazas [Tue, 22 Jun 2021 07:41:18 +0000 (09:41 +0200)]
gtk: Define the GtkListItem autocleanup func

4 years agoMerge branch 'fix-pointer-gestures-kde-plasma' into 'master'
Carlos Garnacho [Mon, 21 Jun 2021 21:35:06 +0000 (21:35 +0000)]
Merge branch 'fix-pointer-gestures-kde-plasma' into 'master'

gdk/wayland: Fix pointer-gestures version selection

See merge request GNOME/gtk!3693

4 years agogdk/wayland: Fix pointer-gestures version selection
Vlad Zahorodnii [Mon, 21 Jun 2021 06:22:29 +0000 (09:22 +0300)]
gdk/wayland: Fix pointer-gestures version selection

version == GDK_ZWP_POINTER_GESTURES_V1_VERSION will fail if the
compositor implements version 2 of pointer-gestures-v1.

4 years agoNever show the Trash in the FileChooserWidget side bar
Emmanuele Bassi [Sun, 20 Jun 2021 14:39:41 +0000 (15:39 +0100)]
Never show the Trash in the FileChooserWidget side bar

The Trash is a special location: files cannot be copied or moved, there,
and the file selection dialog is not able to restore files from the
Trash.

Fixes: #674
4 years agoRevert "Never show the Trash in the FileChooserWidget side bar"
Emmanuele Bassi [Sun, 20 Jun 2021 14:41:43 +0000 (15:41 +0100)]
Revert "Never show the Trash in the FileChooserWidget side bar"

This reverts commit cd39e417e1f816e7c509f9c14e4a0b61fce81430.

4 years agoNever show the Trash in the FileChooserWidget side bar
Emmanuele Bassi [Sun, 20 Jun 2021 14:39:41 +0000 (15:39 +0100)]
Never show the Trash in the FileChooserWidget side bar

The Trash is a special location: files cannot be copied or moved, there,
and the file selection dialog is not able to restore files from the
Trash.

Fixes: #674
4 years agodocs: Fix a typo
Matthias Clasen [Sat, 19 Jun 2021 19:24:12 +0000 (12:24 -0700)]
docs: Fix a typo

4 years agodocs: Add a section about Drag-and-Drop
Matthias Clasen [Sat, 19 Jun 2021 19:23:27 +0000 (12:23 -0700)]
docs: Add a section about Drag-and-Drop

4 years agoMerge branch 'wip/chergert/textview-access-to-contexts' into 'master'
Matthias Clasen [Sat, 19 Jun 2021 20:36:44 +0000 (20:36 +0000)]
Merge branch 'wip/chergert/textview-access-to-contexts' into 'master'

textview: give application developers access to RTL and LTR context

See merge request GNOME/gtk!3690

4 years agocheckbutton: Match GtkButton behavior
Matthias Clasen [Sat, 19 Jun 2021 20:27:55 +0000 (13:27 -0700)]
checkbutton: Match GtkButton behavior

When leaving the widget before releasing the button,
we should not activate the checkbutton, to match the
way GtkButton behaves.

Fixes: #4061
4 years agotextview: give application developers access to RTL and LTR context
Christian Hergert [Sat, 19 Jun 2021 19:20:23 +0000 (12:20 -0700)]
textview: give application developers access to RTL and LTR context

This allows developers to modify the pango context that is used when
rendering text within the text view.

Such access can be useful to alter how rounding occurs with API such as
pango_context_set_round_glyph_positions() and is needed by GtkSourceView
for proper placement of glyphs within the overview map.

4 years agodocs: Tweak wording
Matthias Clasen [Sat, 19 Jun 2021 15:01:57 +0000 (08:01 -0700)]
docs: Tweak wording

Instead of drag'n'drop, say drag-and-drop. That is easier
to read, and less unclear on the markdown syntax implications.

4 years agowayland: Fix some dnd corner case
Matthias Clasen [Sat, 19 Jun 2021 13:57:38 +0000 (06:57 -0700)]
wayland: Fix some dnd corner case

We must call gdk_drag_drop_done() when the drag ends,
successfully or not. Without this, we get an unwarranted
emission of ::cancel after a successful drop.

Since only the first call to gdk_drag_drop_done() is taking
effect, it is safe to call as a fallback, after emitting
::dnd-finished. If the application connects to that signal
and calls gdk_drag_drop_done() itself, its call will take
precedence.

This matches what the X11 implementation does.

4 years agodnd: Add another assertion
Matthias Clasen [Sat, 19 Jun 2021 14:49:04 +0000 (07:49 -0700)]
dnd: Add another assertion

Assert that gdk_drop_finish() is called after the
drop is performed.

4 years agoMerge branch 'fix-3798' into 'master'
Matthias Clasen [Fri, 18 Jun 2021 17:31:51 +0000 (17:31 +0000)]
Merge branch 'fix-3798' into 'master'

GDK-Win32: Fix drag surface positioning (issue #3798)

Closes #3798

See merge request GNOME/gtk!3659

4 years agoMerge branch 'gsk-big-batches' into 'master'
Matthias Clasen [Fri, 18 Jun 2021 17:00:58 +0000 (17:00 +0000)]
Merge branch 'gsk-big-batches' into 'master'

ci: Build Broadway on MacOS

See merge request GNOME/gtk!3686

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 18 Jun 2021 14:09:49 +0000 (14:09 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

ci: Build Broadway on MacOS

See merge request GNOME/gtk!3685

4 years agogsk: Respect max element vertices limitation
Matthias Clasen [Fri, 18 Jun 2021 13:50:59 +0000 (06:50 -0700)]
gsk: Respect max element vertices limitation

We are pretty good at batching commands now, and we can easily
produce batches that exceed the maximum number of elements per
draw call that the hw can handle. Query that number, and respect
it when merging batches.

This fixes the rendering of the overview map in GtkSourceView.

4 years agoci: Build Broadway on MacOS
Matthias Clasen [Fri, 18 Jun 2021 13:08:32 +0000 (06:08 -0700)]
ci: Build Broadway on MacOS

We've seen a build failure if Broadway is built without
the X11 backend. Lets recreate that configuration in ci
so it doesn't break again.

4 years agogdkdrag-win32.c: Fix drag surface positioning
Chun-wei Fan [Fri, 18 Jun 2021 09:58:14 +0000 (17:58 +0800)]
gdkdrag-win32.c: Fix drag surface positioning

Determine the root_x and root_y coordinates of the drag surface by
relying on the coordinates of the surface where the drag is being
carried out, plus the coordinates that we receive from the drag event,
which is in-line with what the X11 backend does.

This will prevent the drag surface from being initially drawn at the
correct position, but jumping towards the top-left corner of the screen
shortly afterwards.

The DnD support will still need some more updates to function correctly
on Windows, but at least this is a small improvement.

Fixes issue #3798.

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 18 Jun 2021 04:37:48 +0000 (04:37 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

treeviewcolumn: Clip header buttons

Closes #4045

See merge request GNOME/gtk!3682

4 years agomacos: implement GdkDrop for macOS
Christian Hergert [Fri, 18 Jun 2021 00:23:10 +0000 (17:23 -0700)]
macos: implement GdkDrop for macOS

This gets the basic mechanics of the drop portion of DnD working on the
macOS backend. You can drag, for example, from TextEdit into GNOME
Text Editor when using the macOS backend.

Other content formats are supported, and match what is currently
supported by the clipboard backend as the implementation to read
from the pasteboard is shared.

Currently, we look up the GdkDrag for the new GdkDrop. However,
nothing is stashing the drag away for further lookup. More work is
needed on GdkMacosDrag for that to be doable.

4 years agomacos: make pasteboard usage reusable
Christian Hergert [Fri, 18 Jun 2021 00:19:19 +0000 (17:19 -0700)]
macos: make pasteboard usage reusable

We will want to be able to reuse the pasteboard reading code from
the macOS DnD drop backend. This just removes the pasteboard
bits from the implementation and allows that to be passed in as in
both clipboard and DnD cases we'll have a specific NSPasteboard
to read from.

4 years agomacos: check for GdkMacosBaseView before using as such
Christian Hergert [Fri, 18 Jun 2021 00:18:19 +0000 (17:18 -0700)]
macos: check for GdkMacosBaseView before using as such

We can get events for external windows such as those from native
file chooser dialogs.

4 years agotreeviewcolumn: Clip header buttons
Matthias Clasen [Thu, 17 Jun 2021 22:54:36 +0000 (15:54 -0700)]
treeviewcolumn: Clip header buttons

We don't want to overdraw when dragging a narrow column
around, and we also need the clipping to avoid picking
the wrong column, when a later column button overlaps
an earlier one.

Fixes: #4045
4 years agomacos: Fix a compiler warning
Matthias Clasen [Thu, 17 Jun 2021 13:40:22 +0000 (09:40 -0400)]
macos: Fix a compiler warning

4 years agomacos: move drag motion to GdkMacosDrag
Christian Hergert [Thu, 17 Jun 2021 20:24:39 +0000 (13:24 -0700)]
macos: move drag motion to GdkMacosDrag

This doesn't help to be pushed off into the surface, as it makes things
more different than the X11 implementation.

4 years agomacos: fix position of drag surface
Christian Hergert [Thu, 17 Jun 2021 20:23:38 +0000 (13:23 -0700)]
macos: fix position of drag surface

4 years agomacos: register known clipboard types for drag destination
Christian Hergert [Thu, 17 Jun 2021 20:23:18 +0000 (13:23 -0700)]
macos: register known clipboard types for drag destination

4 years agoMerge branch 'wip/chergert/fix-broadway-build' into 'master'
Matthias Clasen [Thu, 17 Jun 2021 19:45:16 +0000 (19:45 +0000)]
Merge branch 'wip/chergert/fix-broadway-build' into 'master'

inspector: fix compilation with broadway

See merge request GNOME/gtk!3681

4 years agoinspector: fix compilation with broadway
Christian Hergert [Thu, 17 Jun 2021 18:40:10 +0000 (11:40 -0700)]
inspector: fix compilation with broadway

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Thu, 17 Jun 2021 17:53:16 +0000 (17:53 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

action muxer fixes

See merge request GNOME/gtk!3678

4 years agoUpdate Portuguese translation
Hugo Carvalho [Thu, 17 Jun 2021 14:44:36 +0000 (14:44 +0000)]
Update Portuguese translation

(cherry picked from commit 807537dd5dc306edfae5abd82fbbb3e346f6d682)

4 years agotestsuite: Avoid a compiler warning
Matthias Clasen [Thu, 17 Jun 2021 13:37:45 +0000 (09:37 -0400)]
testsuite: Avoid a compiler warning

This was showing up in ci on macos.

4 years agowidget-factory: Show Ctrl-? in the menu
Matthias Clasen [Thu, 17 Jun 2021 12:59:30 +0000 (08:59 -0400)]
widget-factory: Show Ctrl-? in the menu

We use our own action for showing the shortcuts window,
so we need to associate this shortcut with our action
for it to show up.

4 years agoshortcutcontroller: Don't reinject menu accels
Matthias Clasen [Thu, 17 Jun 2021 12:43:48 +0000 (08:43 -0400)]
shortcutcontroller: Don't reinject menu accels

The normal way to associate accels with actions is
to attach a shortcut controller to the widget. The shorcut
controller will inject the accel into the action muxer
tree, so that it can get displayed in widgets that activate
the action (say, in menus.

This approach does not works for generated menus, since the
widgets are not in the hands of the app developer, so attaching
shortcut controllers to them is impractical.

Instead, GtkModelButton has an accel property that gets
bound to the accel coming from the action muxer tree (most
likely put there via gtk_application_set_accel_for_action),
and creates a shortcut controller itself.

The change in this commit is to prevent the shortcut controller
from injecting the accel into the action muxer tree in this case.
Otherwise, the accels get 'stuck' and we won't update them if the
global accels are later changed.

This is a hack, and needs a better solution.

4 years agowindow: Propagate accel changes
Matthias Clasen [Thu, 17 Jun 2021 12:32:11 +0000 (08:32 -0400)]
window: Propagate accel changes

When the global accels change, tell the
shortcut controller to re-inject them into
the action muxer hierarchy.

4 years agoshortcutcontroller: Add a way to update accels
Matthias Clasen [Thu, 17 Jun 2021 12:31:13 +0000 (08:31 -0400)]
shortcutcontroller: Add a way to update accels

This will be used to make accel changes propagate.

4 years agoaction muxer: Propagate registrations further up
Matthias Clasen [Thu, 17 Jun 2021 12:37:42 +0000 (08:37 -0400)]
action muxer: Propagate registrations further up

We were pretty aggressive about not registering
observers further than necessary, stopping at the
first muxer that provides an action.

But even though action changes further up in the tree
won't be relevant in that case, we need to listen to
accel changes, since they may come from higher up
in the tree (e.g. when using
gtk_application_set_accels_for_action with an action
that is defined on a widget.

So, register all the way to the top, and stop propagating
action changes when we hit a muxer that provides the action.

4 years agomenutrackeritem: Be more careful with accel changes
Matthias Clasen [Thu, 17 Jun 2021 12:42:03 +0000 (08:42 -0400)]
menutrackeritem: Be more careful with accel changes

In some cases (such as when getting a new parent), the
action muxer doesn't know exactly which detailed actions
have changed accels, so we call primary_accel_changed with
just an action name.

Make the menu tracker item handle that case by matching
either against the detailed name or the the action name.

4 years agoaction muxer: Propagate accel changes
Matthias Clasen [Thu, 17 Jun 2021 12:35:59 +0000 (08:35 -0400)]
action muxer: Propagate accel changes

When we set a new parent on an action muxer,
accels may change, so call primary_accel_changed
for involved actions.

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Thu, 17 Jun 2021 11:47:28 +0000 (11:47 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

spinner: Behave like any other icon

See merge request GNOME/gtk!3677

4 years agospinner: Behave like any other icon
Benjamin Otte [Thu, 17 Jun 2021 10:53:01 +0000 (12:53 +0200)]
spinner: Behave like any other icon

Take the size from -gtk-icon-size.

Note that min-width/height still works, as those properties are handled
by the generic widget sizing machinery in GTK4.

4 years agoactionobserver: Clarify primary_accel_changed docs
Matthias Clasen [Wed, 16 Jun 2021 14:34:37 +0000 (10:34 -0400)]
actionobserver: Clarify primary_accel_changed docs

Either action_name or action_and_target may be NULL
here, and observer implementations should be careful
when checking those values.

4 years agoprint-editor: Make accels work
Matthias Clasen [Wed, 16 Jun 2021 14:16:41 +0000 (10:16 -0400)]
print-editor: Make accels work

Sadly, they don't show up anymore with this.

4 years agobloatpad: Add icons as resources
Matthias Clasen [Wed, 16 Jun 2021 13:35:00 +0000 (09:35 -0400)]
bloatpad: Add icons as resources

This can serve as a useful example for how to add
themed icons as resources.

4 years agobloatpad: Give the toolbar a facelift
Matthias Clasen [Wed, 16 Jun 2021 13:26:15 +0000 (09:26 -0400)]
bloatpad: Give the toolbar a facelift

Make it look more like a toolbar.

4 years agobloatpad: Improve accel dialog
Matthias Clasen [Wed, 16 Jun 2021 13:09:24 +0000 (09:09 -0400)]
bloatpad: Improve accel dialog

Make this dialog a bit less of an eyesore.

4 years agoexamples: Use existing icons
Matthias Clasen [Wed, 16 Jun 2021 12:45:04 +0000 (08:45 -0400)]
examples: Use existing icons

The sunny icon doesn't exist anymore.

4 years agoexamples: Drop a redundant frame
Matthias Clasen [Wed, 16 Jun 2021 12:40:01 +0000 (08:40 -0400)]
examples: Drop a redundant frame

The frame in the drawing example adds nothing
and looks wrong.

4 years agoMerge branch 'fix-3793' into 'master'
Matthias Clasen [Wed, 16 Jun 2021 10:08:52 +0000 (10:08 +0000)]
Merge branch 'fix-3793' into 'master'

gdksurface-win32.c: Fix up popup placement (fix issue #3793)

Closes #3793

See merge request GNOME/gtk!3674

4 years agoMerge branch 'media-stream-name-collision' into 'master'
Matthias Clasen [Wed, 16 Jun 2021 10:07:29 +0000 (10:07 +0000)]
Merge branch 'media-stream-name-collision' into 'master'

mediastream: Some more api renaming

Closes #4023

See merge request GNOME/gtk!3673

4 years agogdksurface-win32.c: Fix up popup placement
Chun-wei Fan [Wed, 16 Jun 2021 04:24:47 +0000 (12:24 +0800)]
gdksurface-win32.c: Fix up popup placement

If we are undergoing a surface move, just apply the next_layout anyways,
even if we are not moving a toplevel surface.

Update the way how we obtain the x and y coordinates of a surface, if it
is a toplevel, apply the x and y coordinates from the results from we
obtained the underlying Win32 HWND, as we did before.  But if it is a
popup, use gdk_win32_surface_get_geometry() to obtain the correct x and
y coordinates to place our popup surface.

Also correct how we compute the shadow dimensions, and the final popup
rectangle as we attempt to layout the popup surface, since GDK-Win32
keeps track of the shadow dimensions in system (unscaled) units, not GDK
units.

Fixes issue #3793.

4 years agogdksurface-win32.c: Fix formatting for popup functions
Chun-wei Fan [Tue, 15 Jun 2021 08:01:09 +0000 (16:01 +0800)]
gdksurface-win32.c: Fix formatting for popup functions

4 years agoMerge branch 'drop-target-name-collision' into 'master'
Matthias Clasen [Wed, 16 Jun 2021 00:12:53 +0000 (00:12 +0000)]
Merge branch 'drop-target-name-collision' into 'master'

droptarget: Rename :drop to :current-drop

Closes #4028

See merge request GNOME/gtk!3669

4 years agomediastream: Some more api renaming
Matthias Clasen [Mon, 14 Jun 2021 11:25:06 +0000 (07:25 -0400)]
mediastream: Some more api renaming

Also rename gtk_media_stream_ended to
gtk_media_stream_set_ended, to avoid naming
collision with GtkMediaStream:ended.

The existing entry points still exist, deprecated
and marked as non-introspectable.

Update all internal uses.

Fixes: #4023
4 years agodroptarget: Rename :drop to :current-drop
Matthias Clasen [Mon, 14 Jun 2021 20:23:35 +0000 (16:23 -0400)]
droptarget: Rename :drop to :current-drop

Rename the GtkDropTraget:drop property to :current-drop,
to avoid naming collision with the signal of the same
name.

We leave the old property and getter in place, deprecated
and marked as non-introspectable.

Fixes: #4028
4 years agoMerge branch 'cherry-pick-4ba89f25' into 'master'
Matthias Clasen [Tue, 15 Jun 2021 20:29:28 +0000 (20:29 +0000)]
Merge branch 'cherry-pick-4ba89f25' into 'master'

cellarea: Don't shrink area too much

See merge request GNOME/gtk!3672

4 years agoMerge branch 'label-underline-markup' into 'master'
Matthias Clasen [Tue, 15 Jun 2021 19:43:40 +0000 (19:43 +0000)]
Merge branch 'label-underline-markup' into 'master'

label: Fix mnemonic handling

Closes #4041

See merge request GNOME/gtk!3670

4 years agocellarea: Don't shrink area too much
Benjamin Otte [Tue, 15 Jun 2021 17:34:37 +0000 (19:34 +0200)]
cellarea: Don't shrink area too much

Do not compute rectangles with negative width/height. This avoids
assertion failures further down when those rectangles were actually
checked.

https://bugzilla.redhat.com/show_bug.cgi?id=1962215

(cherry picked from commit 4ba89f25b8a88616afc1915bdb4fb87d13efae6f)

4 years agoAdd a mnemonic testcase
Matthias Clasen [Tue, 15 Jun 2021 17:32:31 +0000 (13:32 -0400)]
Add a mnemonic testcase

Add a testcase that tests the label mnemonic handling
that was fixed in the previous commit.

4 years agolabel: Fix mnemonic handling
Matthias Clasen [Tue, 15 Jun 2021 17:06:10 +0000 (13:06 -0400)]
label: Fix mnemonic handling

We were not handling the case right in which we
want to use underlines, but not use markup. Since
we are now using pango_parse_markup for this case,
we need to escape the xml markup.

Fixes: #4041